import {createRouter, createWebHistory} from 'vue-router'
import Login from '../views/LoginView.vue'

const routes = [
    {
        path: '/',
        redirect: '/Login'
    },

    {
        path: '/Login',
        name: 'Login',
        component: Login
    },
    {
        path: '/Home',
        name: 'Home',
        component: () => import('../views/HomeView.vue'),
        children: [
            {
                path: 'Course',
                name: 'Course',
                component: () => import('../components/form/right/genminghui/CourseComponent.vue')
            },
            {
                path: 'CourseReview',
                name: 'CourseReview',
                component: () => import('../components/form/right/genminghui/CourseReviewComponent.vue')
            },
            {
                path: 'CourseQuestion',
                name:'CourseQuestion',
                component: () => import('../components/form/right/genminghui/CourseQuestionComponent.vue')
            },
            {
                path: 'fm',
                name: 'fm',
                component: () => import('../components/form/ operate/sunkaixuan/FM.vue')
            },
            {
                path: 'PsychologicalKnowledge',
                name: 'PsychologicalKnowledge',
                component: () => import('../components/form/ operate/sunkaixuan/PsychologicalKnowledge.vue')
            }, {
                path: 'PrivateMessage',
                name: 'PrivateMessage',
                component: () => import('../components/form/right/sunnan/PrivateMessage.vue')
            }, {
                path: 'PublicWelfareCenter',
                name: 'PublicWelfareCenter',
                component: () => import('../components/form/right/sunnan/PublicWelfareCenter.vue')
            }, {
                path: 'PsychologicalKnowledge',
                name: 'PsychologicalKnowledge',
                component: () => import('../components/form/ operate/sunkaixuan/PsychologicalKnowledge.vue')
            }, {
                path: 'PrivateMessage',
                name: 'PrivateMessage',
                component: () => import('../components/form/right/sunnan/PublicWelfareCenter.vue')
            }, {
                path: 'ArticlesDetail',
                name: 'ArticlesDetail',
                component: () => import('../components/form/right/liujinping/ArticlesDetail.vue')
            },
            {
                path: 'mine',
                name: 'mine',
                component: () => import('../components/form/right/lishenao/Mine.vue')
            },
            {
                path: 'department',
                name: 'department',
                component: () => import('../components/form/Department.vue')
            },
            {
                path: 'position',
                name: 'position',
                component: () => import('../components/form/Position.vue')
            }, {
                path: 'articles',
                name: 'articles',
                component: () => import('../components/form/right/liujinping/Articles.vue'),
                children: []
            }, {
                path: 'editArticles',
                name: 'editArticles',
                component: () => import('../components/form/right/liujinping/EditArticles.vue'),
                props: true // 允许将路由参数作为 props 传递给组件
            }
        ]
    },

]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
